package com.usian.feign;

import com.usian.pojo.*;
import com.usian.utils.CateGroup;
import com.usian.utils.FengZ;
import com.usian.utils.PageResult;
import com.usian.utils.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(value = "usian-item-service")
public interface ItemFeign {

    @RequestMapping("finda")
    public List<TbItem> findall();

    @RequestMapping("selectTbItemAllByPage")
    public PageResult selectTbItemAllByPage(@RequestParam Integer page, @RequestParam Integer rows);


    @RequestMapping("/selectItemParamByItemCatId/{itemCatId}")
    public TbItemParam selectItemParamByItemCatId(@PathVariable Integer itemCatId);

    @RequestMapping("insertTbItem")
    public int insertTbItem(@RequestBody TbItem tbItem, @RequestParam String desc, @RequestParam String itemParams);

    @RequestMapping("deleteItemById")
    public int deleteItemById(@RequestParam String itemId);

    @RequestMapping("preUpdateItem")
    Map<String, Object> preUpdateItem(@RequestParam Long itemId);

    @RequestMapping("updateTbItem")
    public int updateTbItem(@RequestBody TbItem tbItem, @RequestParam String desc, @RequestParam String itemParams);

    @RequestMapping("selectItemParamAll")
    public PageResult selectItemParamAll();

    @RequestMapping("insertItemParam")
    public int insertItemParam(@RequestParam Integer itemCatId, @RequestParam String paramData);

    @RequestMapping("deleteItemParamById")
    public int deleteItemParamById(@RequestParam Integer id);

    @RequestMapping("selectItemCategoryAll")
    public FengZ selectItemCategoryAll();

    @RequestMapping("selectItemInfo")
    TbItem selectItemInfo(@RequestParam long itemId);

    @RequestMapping("selectItemDescByItemId")
    TbItemDesc selectItemDescByItemId(@RequestParam long itemId);
    @RequestMapping("selectTbItemParamItemByItemId")
    TbItemParamItem selectTbItemParamItemByItemId(@RequestParam long itemId);
}
